const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const common = require("./webpack.common.js")
const { merge } = require("webpack-merge")


module.exports = merge(common, {
  mode: "production",
  output: {
    filename: '[name]-[contenthash:8].bundle.js',
  },
  plugins: [
    new CleanWebpackPlugin(),
    new CopyWebpackPlugin({
      patterns: [
        { from: "public", to: "public" }
      ]
    })
  ]
})